//
//  itemcell.m
//  maocuhuiOASystem
//
//  Created by michael on 16/3/20.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "itemcell.h"

@implementation itemcell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

    self.imageview = [[UIImageView alloc]init];
    
    self.imageview.frame = CGRectMake(10, 0, self.width-20, self.width-20);
    
    self.textlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.imageview.bottom+10, self.width, 20)];
        self.textlabel.font = [UIFont systemFontOfSize:13];
    self.textlabel.textAlignment = NSTextAlignmentCenter;

    self.numberlabel = [[UILabel alloc]initWithFrame:CGRectMake(self.width-25, 5,15,15)];
    self.numberlabel.layer.cornerRadius = 7.5;
    self.numberlabel.layer.masksToBounds = YES;
    self.numberlabel.backgroundColor = [UIColor redColor];
    self.numberlabel.textColor = [UIColor whiteColor];
    self.numberlabel.font = [UIFont systemFontOfSize:13];
    self.numberlabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:self.imageview];
[self.contentView addSubview:self.textlabel];
[self.imageview addSubview:self.numberlabel];
self.numberlabel.hidden = YES;
    }
    return self;
}
- (void)layoutSubviews
{
[super layoutSubviews];
self.textlabel.text = self.dataList;
//[self.button setBackgroundImage:[UIImage imageNamed:self.dataList] forState:UIControlStateNormal];
[self.imageview setImage:[UIImage imageNamed:self.dataList]];
//if ([self.dataList isEqualToString:@"通讯录"]) {
//    self.textlabel.frame =CGRectMake(20, self.imageview.bottom+10, self.width, 20);
//    }
//    if ([self.dataList isEqualToString:@"专网"]||[self.dataList isEqualToString:@"外网"]) {
//    self.textlabel.frame =CGRectMake(27, self.imageview.bottom+10, self.width, 20);
//}
//self.numberlabel.text = @"5";
}

- (void)awakeFromNib {
    // Initialization code
}

@end
